package com.api.shopapi.service.impl;

import com.api.shopapi.entity.VerificationCode;
import com.api.shopapi.mapper.VerificationCodeMapper;
import com.api.shopapi.service.VerificationCodeService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service("VerificationCodeServiceImplOne")
public class VerificationCodeServiceImpl implements VerificationCodeService {
    @Autowired
    private VerificationCodeMapper verificationCodeMapper;

    @Override
    public int insert(VerificationCode verificationCode) {
        return verificationCodeMapper.insert(verificationCode);
    }

    @Override
    public int delete(String verificationCodeCode) {
        return verificationCodeMapper.delete(verificationCodeCode);
    }

    @Override
    public int update(VerificationCode verificationCode) {
        return verificationCodeMapper.update(verificationCode);
    }

    @Override
    public List<VerificationCode> getList() {
        return verificationCodeMapper.getList();
    }

    @Override
    public VerificationCode getByVerificationCodeCode(String verificationCodeCode) {
        return verificationCodeMapper.getByVerificationCodeCode(verificationCodeCode);
    }

    @Override
    public
    VerificationCode getByPhone(String phone){
        return verificationCodeMapper.getByPhone(phone);
    }

    @Override
    public
    VerificationCode getByLoginNamePhone(String loginName, String phone){
        return verificationCodeMapper.getByLoginNamePhone(loginName,phone);
    }

}
